<?php

namespace common\models;

use yii\base\Model;
use yii\web\UploadedFile;

class UploadForm extends Model
{
    /**
     * @var UploadedFile
     */
    public $imageFile;

    public function rules()
    {
        return [
            [['imageFile'], 'file', 'maxFiles' => 10,'extensions' => 'png, jpg'],

        ];
    }

    // public function upload()
    // {
    //     if ($this->validate()) {
    //         $path='uploads/' . $this->imageFile->baseName . '.' . $this->imageFile->extension;
    //         $this->imageFile->saveAs($path);
    //         return true;
    //     } else {

    //         return false;
    //     }
    // }
}
